<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class City extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'city';

    public static function getAreaList($name)
    {
        $pid = self::where('name',$name)->first()->id;
        return self::where('pid',$pid)->get()->pluck(['id'=>'name']);
    }
    public static function selArea($name){
        $pid = self::where('name',$name)->first()->id;
        return self::where('pid',$pid)->get()->pluck('name','id');
    }
}
